/*
 * 作者:熊猫
 * 日期:2017 - 3 - 19 11 - 25 - 55
 *
 */

package net.lainiao.morethread.Chapter7.demo9;

import java.util.Comparator;

/**
 * Created by Administrator on 2017/3/19.
 */
public class Event implements Comparable<Event> {
    private String thread;
    private int priority;
    public Event(String thread,int priority){
        this.thread=thread;
        this.priority=priority;
    }

    @Override
    public int compareTo(Event o) {
         if(this.priority>o.priority){
             return 1;
         }
         if(this.priority<o.priority){
             return -1;
         }
         return 0;
    }

    public String getThread() {
        return thread;
    }

    public int getPriority() {
        return priority;
    }
}
